/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.portlet.donggoi.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;

import com.portlet.donggoi.model.chiTietQTDongGoi;
import com.portlet.donggoi.model.chiTietQTDongGoiModel;

import java.io.Serializable;

import java.sql.Types;

import java.util.HashMap;
import java.util.Map;

/**
 * The base model implementation for the chiTietQTDongGoi service. Represents a row in the &quot;ct_chiTietQTDongGoi&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.portlet.donggoi.model.chiTietQTDongGoiModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link chiTietQTDongGoiImpl}.
 * </p>
 *
 * @author Thi
 * @see chiTietQTDongGoiImpl
 * @see com.portlet.donggoi.model.chiTietQTDongGoi
 * @see com.portlet.donggoi.model.chiTietQTDongGoiModel
 * @generated
 */
public class chiTietQTDongGoiModelImpl extends BaseModelImpl<chiTietQTDongGoi>
	implements chiTietQTDongGoiModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. All methods that expect a chi tiet q t dong goi model instance should use the {@link com.portlet.donggoi.model.chiTietQTDongGoi} interface instead.
	 */
	public static final String TABLE_NAME = "ct_chiTietQTDongGoi";
	public static final Object[][] TABLE_COLUMNS = {
			{ "maChiTietQT", Types.VARCHAR },
			{ "tenCongDoan", Types.VARCHAR },
			{ "cachThucHien", Types.VARCHAR },
			{ "kiemTraThucHien", Types.VARCHAR },
			{ "tanSuat", Types.VARCHAR },
			{ "maQuyTrinh", Types.VARCHAR }
		};
	public static final String TABLE_SQL_CREATE = "create table ct_chiTietQTDongGoi (maChiTietQT VARCHAR(75) not null primary key,tenCongDoan VARCHAR(75) null,cachThucHien VARCHAR(75) null,kiemTraThucHien VARCHAR(75) null,tanSuat VARCHAR(75) null,maQuyTrinh VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table ct_chiTietQTDongGoi";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.portlet.donggoi.model.chiTietQTDongGoi"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.portlet.donggoi.model.chiTietQTDongGoi"),
			true);
	public static final boolean COLUMN_BITMASK_ENABLED = false;
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.portlet.donggoi.model.chiTietQTDongGoi"));

	public chiTietQTDongGoiModelImpl() {
	}

	public String getPrimaryKey() {
		return _maChiTietQT;
	}

	public void setPrimaryKey(String primaryKey) {
		setMaChiTietQT(primaryKey);
	}

	public Serializable getPrimaryKeyObj() {
		return _maChiTietQT;
	}

	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey((String)primaryKeyObj);
	}

	public Class<?> getModelClass() {
		return chiTietQTDongGoi.class;
	}

	public String getModelClassName() {
		return chiTietQTDongGoi.class.getName();
	}

	@Override
	public Map<String, Object> getModelAttributes() {
		Map<String, Object> attributes = new HashMap<String, Object>();

		attributes.put("maChiTietQT", getMaChiTietQT());
		attributes.put("tenCongDoan", getTenCongDoan());
		attributes.put("cachThucHien", getCachThucHien());
		attributes.put("kiemTraThucHien", getKiemTraThucHien());
		attributes.put("tanSuat", getTanSuat());
		attributes.put("maQuyTrinh", getMaQuyTrinh());

		return attributes;
	}

	@Override
	public void setModelAttributes(Map<String, Object> attributes) {
		String maChiTietQT = (String)attributes.get("maChiTietQT");

		if (maChiTietQT != null) {
			setMaChiTietQT(maChiTietQT);
		}

		String tenCongDoan = (String)attributes.get("tenCongDoan");

		if (tenCongDoan != null) {
			setTenCongDoan(tenCongDoan);
		}

		String cachThucHien = (String)attributes.get("cachThucHien");

		if (cachThucHien != null) {
			setCachThucHien(cachThucHien);
		}

		String kiemTraThucHien = (String)attributes.get("kiemTraThucHien");

		if (kiemTraThucHien != null) {
			setKiemTraThucHien(kiemTraThucHien);
		}

		String tanSuat = (String)attributes.get("tanSuat");

		if (tanSuat != null) {
			setTanSuat(tanSuat);
		}

		String maQuyTrinh = (String)attributes.get("maQuyTrinh");

		if (maQuyTrinh != null) {
			setMaQuyTrinh(maQuyTrinh);
		}
	}

	public String getMaChiTietQT() {
		if (_maChiTietQT == null) {
			return StringPool.BLANK;
		}
		else {
			return _maChiTietQT;
		}
	}

	public void setMaChiTietQT(String maChiTietQT) {
		_maChiTietQT = maChiTietQT;
	}

	public String getTenCongDoan() {
		if (_tenCongDoan == null) {
			return StringPool.BLANK;
		}
		else {
			return _tenCongDoan;
		}
	}

	public void setTenCongDoan(String tenCongDoan) {
		_tenCongDoan = tenCongDoan;
	}

	public String getCachThucHien() {
		if (_cachThucHien == null) {
			return StringPool.BLANK;
		}
		else {
			return _cachThucHien;
		}
	}

	public void setCachThucHien(String cachThucHien) {
		_cachThucHien = cachThucHien;
	}

	public String getKiemTraThucHien() {
		if (_kiemTraThucHien == null) {
			return StringPool.BLANK;
		}
		else {
			return _kiemTraThucHien;
		}
	}

	public void setKiemTraThucHien(String kiemTraThucHien) {
		_kiemTraThucHien = kiemTraThucHien;
	}

	public String getTanSuat() {
		if (_tanSuat == null) {
			return StringPool.BLANK;
		}
		else {
			return _tanSuat;
		}
	}

	public void setTanSuat(String tanSuat) {
		_tanSuat = tanSuat;
	}

	public String getMaQuyTrinh() {
		if (_maQuyTrinh == null) {
			return StringPool.BLANK;
		}
		else {
			return _maQuyTrinh;
		}
	}

	public void setMaQuyTrinh(String maQuyTrinh) {
		_maQuyTrinh = maQuyTrinh;
	}

	@Override
	public chiTietQTDongGoi toEscapedModel() {
		if (_escapedModel == null) {
			_escapedModel = (chiTietQTDongGoi)ProxyUtil.newProxyInstance(_classLoader,
					_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
		}

		return _escapedModel;
	}

	public chiTietQTDongGoi toUnescapedModel() {
		return (chiTietQTDongGoi)this;
	}

	@Override
	public Object clone() {
		chiTietQTDongGoiImpl chiTietQTDongGoiImpl = new chiTietQTDongGoiImpl();

		chiTietQTDongGoiImpl.setMaChiTietQT(getMaChiTietQT());
		chiTietQTDongGoiImpl.setTenCongDoan(getTenCongDoan());
		chiTietQTDongGoiImpl.setCachThucHien(getCachThucHien());
		chiTietQTDongGoiImpl.setKiemTraThucHien(getKiemTraThucHien());
		chiTietQTDongGoiImpl.setTanSuat(getTanSuat());
		chiTietQTDongGoiImpl.setMaQuyTrinh(getMaQuyTrinh());

		chiTietQTDongGoiImpl.resetOriginalValues();

		return chiTietQTDongGoiImpl;
	}

	public int compareTo(chiTietQTDongGoi chiTietQTDongGoi) {
		String primaryKey = chiTietQTDongGoi.getPrimaryKey();

		return getPrimaryKey().compareTo(primaryKey);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (!(obj instanceof chiTietQTDongGoi)) {
			return false;
		}

		chiTietQTDongGoi chiTietQTDongGoi = (chiTietQTDongGoi)obj;

		String primaryKey = chiTietQTDongGoi.getPrimaryKey();

		if (getPrimaryKey().equals(primaryKey)) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	@Override
	public void resetOriginalValues() {
	}

	@Override
	public CacheModel<chiTietQTDongGoi> toCacheModel() {
		chiTietQTDongGoiCacheModel chiTietQTDongGoiCacheModel = new chiTietQTDongGoiCacheModel();

		chiTietQTDongGoiCacheModel.maChiTietQT = getMaChiTietQT();

		String maChiTietQT = chiTietQTDongGoiCacheModel.maChiTietQT;

		if ((maChiTietQT != null) && (maChiTietQT.length() == 0)) {
			chiTietQTDongGoiCacheModel.maChiTietQT = null;
		}

		chiTietQTDongGoiCacheModel.tenCongDoan = getTenCongDoan();

		String tenCongDoan = chiTietQTDongGoiCacheModel.tenCongDoan;

		if ((tenCongDoan != null) && (tenCongDoan.length() == 0)) {
			chiTietQTDongGoiCacheModel.tenCongDoan = null;
		}

		chiTietQTDongGoiCacheModel.cachThucHien = getCachThucHien();

		String cachThucHien = chiTietQTDongGoiCacheModel.cachThucHien;

		if ((cachThucHien != null) && (cachThucHien.length() == 0)) {
			chiTietQTDongGoiCacheModel.cachThucHien = null;
		}

		chiTietQTDongGoiCacheModel.kiemTraThucHien = getKiemTraThucHien();

		String kiemTraThucHien = chiTietQTDongGoiCacheModel.kiemTraThucHien;

		if ((kiemTraThucHien != null) && (kiemTraThucHien.length() == 0)) {
			chiTietQTDongGoiCacheModel.kiemTraThucHien = null;
		}

		chiTietQTDongGoiCacheModel.tanSuat = getTanSuat();

		String tanSuat = chiTietQTDongGoiCacheModel.tanSuat;

		if ((tanSuat != null) && (tanSuat.length() == 0)) {
			chiTietQTDongGoiCacheModel.tanSuat = null;
		}

		chiTietQTDongGoiCacheModel.maQuyTrinh = getMaQuyTrinh();

		String maQuyTrinh = chiTietQTDongGoiCacheModel.maQuyTrinh;

		if ((maQuyTrinh != null) && (maQuyTrinh.length() == 0)) {
			chiTietQTDongGoiCacheModel.maQuyTrinh = null;
		}

		return chiTietQTDongGoiCacheModel;
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(13);

		sb.append("{maChiTietQT=");
		sb.append(getMaChiTietQT());
		sb.append(", tenCongDoan=");
		sb.append(getTenCongDoan());
		sb.append(", cachThucHien=");
		sb.append(getCachThucHien());
		sb.append(", kiemTraThucHien=");
		sb.append(getKiemTraThucHien());
		sb.append(", tanSuat=");
		sb.append(getTanSuat());
		sb.append(", maQuyTrinh=");
		sb.append(getMaQuyTrinh());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(22);

		sb.append("<model><model-name>");
		sb.append("com.portlet.donggoi.model.chiTietQTDongGoi");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>maChiTietQT</column-name><column-value><![CDATA[");
		sb.append(getMaChiTietQT());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>tenCongDoan</column-name><column-value><![CDATA[");
		sb.append(getTenCongDoan());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cachThucHien</column-name><column-value><![CDATA[");
		sb.append(getCachThucHien());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>kiemTraThucHien</column-name><column-value><![CDATA[");
		sb.append(getKiemTraThucHien());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>tanSuat</column-name><column-value><![CDATA[");
		sb.append(getTanSuat());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>maQuyTrinh</column-name><column-value><![CDATA[");
		sb.append(getMaQuyTrinh());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private static ClassLoader _classLoader = chiTietQTDongGoi.class.getClassLoader();
	private static Class<?>[] _escapedModelInterfaces = new Class[] {
			chiTietQTDongGoi.class
		};
	private String _maChiTietQT;
	private String _tenCongDoan;
	private String _cachThucHien;
	private String _kiemTraThucHien;
	private String _tanSuat;
	private String _maQuyTrinh;
	private chiTietQTDongGoi _escapedModel;
}